<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>watch监控，目前只能监控在data中声明的东西</title>
</head>
<body>
<div id="app">

    <input  v-model="user.name"/>
</div>

<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let app = new Vue({
        el: "#app",
        data:{
           user:{
               id:10086,
               name:"ldh",
               age:50
           }
        },
        watch:{
            user:{
                deep:true, //深度监控，监控对象自身以及对象内部的属性的值
                handler(val){
                    console.log(val)
                }
            }
        }



    });
</script>

</body>
</html>